local function main(userOb, msgData)
    if not msgData.pops then
        return
    end

    local prop = INVENTORY_D:get_prop_by_pos(userOb, msgData.pops)
    if not prop then
        local result = {}
        result.code = 400
        userOb:send_packet("MSGS2CCritUP", result)
        return
    end

    local num = 0
    local buyCount = userOb:query("critup_luck") or 0
    local integer, decimal = math.modf(buyCount / 100)
    if decimal == 0 then
        local common = IMPORT_D:query("common")
        local tb = common.weaponLuckUpNum
        buyCount = (integer - 1) % #tb
        num = tb[buyCount+1]
    end

    ---! 升级当前指定装备
    INVENTORY_D:improve_weapon_level(userOb, prop, num)

    local result = {}
    result.code = 200
    result.id = prop.propId
    userOb:send_packet("MSGS2CCritUP", result)
    ITEM_D:send_props_info(userOb)
end

COMMAND_D:register_command("MSGC2SCritUP",GameCmdType.NONE, main)
